//
//  HomeNormalCell.m
//  Ranging_dev
//
//  Created by Mr.Dynasty on 2019/4/1.
//  Copyright © 2019 Mr.Dynasty. All rights reserved.
//

#import "HomeNormalCell.h"

@interface HomeNormalCell ()

@property (strong, nonatomic) UILabel *titleLabel;

@end

@implementation HomeNormalCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self makeCell];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)makeCell {
    UIView *backView = [[UIView alloc] init];
    [self addSubview:backView];
    
    [backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
        make.height.equalTo(60);
    }];
    
    UIImageView *leftImage = [[UIImageView alloc] init];
    leftImage.image = [UIImage imageNamed:@"attention_company"];
    [backView addSubview:leftImage];
    [leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(backView).offset(10);
        make.width.height.equalTo(45);
        make.centerY.equalTo(backView.mas_centerY);
    }];
    
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.font = RegularDefaultFont;
    _titleLabel.textColor = TextBlackColor;
    [backView addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(leftImage.mas_right).offset(10);
        make.centerY.equalTo(backView.mas_centerY);
        make.right.equalTo(backView).offset(-10);
    }];
    
}

- (void)showCell:(NSString *)content {
    _titleLabel.text = content;
}

@end
